package com.dxl.web.common.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

import com.dxl.lanju.service.OssManager;
import com.dxl.service.sysprop.SysPropCacheManager;

public class InitDataLisener implements ServletContextListener {
	private static final Logger LOG = Logger.getLogger(InitDataLisener.class);
	@Override
	public void contextDestroyed(ServletContextEvent event) {
		OssManager.shutdown();
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		SysPropCacheManager.init();
		LOG.info("初始化缓存结束");
		SysPropCacheManager.setRootDir(event.getServletContext().getRealPath("/"));
		LOG.info("系统路径：" + event.getServletContext().getRealPath("/"));
		OssManager.init();
		LOG.info("初始化OSS服务结束");
	}
}
